package leetcode;

public class PrefixCount {
    public static void main(String[] args) {
        PrefixCount prefixCount = new PrefixCount();
        String[] words = {"i", "p", "pet", "fxai", "ortqpwkukg", "rxgh", "ylfh"};
        String pref = "ikwjoty";
        System.out.println(prefixCount.prefixCount(words, pref));
    }

    public int prefixCount(String[] words, String pref) {
        int ans = 0;
        for (String word : words) {
            if (word.startsWith(pref)) {
                ans++;
            }
        }
        return ans;
    }
}
